<?php

/**
 * Secciones filter form base class.
 *
 * @package    turnos
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseSeccionesFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'numero'       => new sfWidgetFormFilterInput(),
      'profesor'     => new sfWidgetFormFilterInput(),
      'sigla_curso'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cursos'), 'add_empty' => true)),
      'campus'       => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'numero'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'profesor'     => new sfValidatorPass(array('required' => false)),
      'sigla_curso'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Cursos'), 'column' => 'sigla')),
      'campus'       => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('secciones_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Secciones';
  }

  public function getFields()
  {
    return array(
      'id_secciones' => 'Number',
      'numero'       => 'Number',
      'profesor'     => 'Text',
      'sigla_curso'  => 'ForeignKey',
      'campus'       => 'Text',
    );
  }
}
